import 'package:flutter/material.dart';
import 'package:flutter_pickers/pickers.dart';
import 'package:flutter_pickers/style/picker_style.dart';
import 'package:flutter_pickers/time_picker/model/date_mode.dart';
import 'package:flutter_pickers/time_picker/model/pduration.dart';
import 'package:flutter_pickers/time_picker/model/suffix.dart';

class PickerUtil {
  static void showDatePicker(
    BuildContext context, {
    DateMode mode = DateMode.YMD,
    Suffix? suffix,
    Widget? title,
    Widget? commitButton,
    Widget? cancelButton,
    Function(bool)? onCancel,
    Function(PDuration)? onChanged,
    Function(PDuration)? onConfirm,
  }) {
    Pickers.showDatePicker(
      context,
      mode: mode,
      suffix: suffix,
      pickerStyle: PickerStyle(
        context: context,
        title: title,
        commitButton: commitButton,
        cancelButton: cancelButton,
      ),
      onCancel: onCancel,
      onChanged: onChanged,
      onConfirm: onConfirm,
    );
  }
}
